﻿//********************************************************************************//
//创建日期：<创建日期，2016-04-24>
//创建作者：<郭登杰，guodengjie@shanghai3h.com>
//功能说明：处理文件相关 (导出)
//********************************************************************************//
using System;
using System.Collections.Generic;
using System.Web;
using Newtonsoft.Json;
using Entity;
using YXYLCommon;
using System.Data;
using BLL.Access;
using BLL;
using System.Web.SessionState;

namespace Web.ashx
{
    
    /// <summary>
    /// Common 的摘要说明
    /// </summary>
    public class Export : IHttpHandler, IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {            
            if(context.Request["op"]=="Excel")
            {
                string filename=context.Request["filename"];
                string tablecontent = context.Request["content"];
                context.Response.ContentEncoding = System.Text.Encoding.UTF8;
                context.Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(filename, System.Text.Encoding.UTF8).ToString());
                context.Response.ContentType = "application/ms-excel;charset=UTF-8";
                context.Response.Write(tablecontent);
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }

}